const Mock = require('mockjs')

const data = Mock.mock({
    "list|7":[{
        "id":"@id",
        "sum":0,
        "title":"@ctitle(4)",
        "children|30":[{
            "id":"@id",
            "img":"@image(80x80,@color)",
            "title":"@ctitle(4,6)",
            "desc":"@ctitle(10)",
            "price|30-100":30,
            "num":0,
            "flag":false
        }]
    }]
})

module.exports = {
    devServer:{
        hot:true,
        open:true,
        port:8080,
        before(app){
            app.get('/api/list',(req,res)=>{
                res.send(data.list)
            })
        }
    }
}